#include <algorithm>
#include <iomanip>
#include <iostream>
using namespace std;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1005;

int n, m, num;
double x[N];
struct Line {
  double x1, x2, y;
  int op;
  bool operator<(Line o) const {
    if (y != o.y) return y < o.y;
    return op < o.op;
  }
  Line() {}
  Line(double _x1, double _x2, double _y, int _op)
      : x1(_x1), x2(_x2), y(_y), op(_op) {}
} lines[N];
double sum[N << 2];
int tag[N << 2];
void build(int p, int l, int r) {
  tag[p] = 0, sum[p] = 0;
  if (l + 1 == r) return;
  int mid = (l + r) >> 1;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid, r);
}
void pushup(int p, int l, int r) {
  if (tag[p])
    sum[p] = x[r] - x[l];
  else if (l + 1 == r)
    sum[p] = 0;
  else
    sum[p] = sum[p << 1] + sum[p << 1 | 1];
}
void update(int L, int R, int d, int p, int l, int r) {
  if (L <= l && R >= r) {
    tag[p] += d;
    pushup(p, l, r);
    return;
  }
  int mid = (l + r) >> 1;
  if (L < mid) update(L, R, d, p << 1, l, mid);
  if (R > mid) update(L, R, d, p << 1 | 1, mid, r);
  pushup(p, l, r);
}
void solve() {
  static int id = 0;
  rep(i, 1, n) {
    double x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    lines[i] = Line(x1, x2, y1, 1);
    lines[i + n] = Line(x1, x2, y2, -1);
    x[i] = x1, x[i + n] = x2;
  }
  sort(lines + 1, lines + n * 2 + 1);
  sort(x + 1, x + n * 2 + 1);
  num = unique(x + 1, x + n * 2 + 1) - x - 1;

  build(1, 1, num);
  double pre = 0;
  double ans = 0;
  rep(i, 1, n * 2) {
    double h = lines[i].y;
    ans += sum[1] * (h - pre);
    pre = h;
    int L = lower_bound(x + 1, x + num + 1, lines[i].x1) - x;
    int R = lower_bound(x + 1, x + num + 1, lines[i].x2) - x;
    update(L, R, lines[i].op, 1, 1, num);
  }
  cout << "Test case #" << ++id << endl;
  cout << "Total explored area: " << fixed << setprecision(2) << ans << endl;
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  while (cin >> n && n) solve();
  return 0;
}